var axios =require("axios");

var movieApi={
	/*视频信息*/
	getMovieView : (aid)=> {
		return axios.get('http://api.bilibili.com/view',{
			params:{"type":"json","appkey":"422fd9d7289a1dd9" ,"batch":"l","check_area":"l","id":aid}
		})
      .then(function (data) {
        return data.data;
      })
      .catch(function (err) { console.warn('Error in getMovieView', err) })
		
	},
	
	getMoviePlayerUrl :(cid)=>{
		return axios.get('http://interface.bilibili.com/playurl',{
			params:{"otype":"json","cid":cid ,"type":"mp4","appkey":"422fd9d7289a1dd9","quality":"4","platform":"bilihelper"}
		})
      .then(function (data) {
        return data.data;
      })
      .catch(function (err) { console.warn('Error in getMoviePlayerUrl', err) })
	}
};

export {movieApi};